home *** CD-ROM | disk | FTP | other *** search
/ Aminet 15 / Aminet 15 - Nov 1996.iso / Aminet / dev / misc / GMSV03B.lha / GamesMaster / Source / Asm / RasterEffects / AGAMirror.s < prev    next >
Encoding:
Text File  |  1996-09-11  |  4.6 KB  |  171 lines

  1. ;AGA Mirror Demo
  2. ;---------------
  3. ;Demo of the mirroring effect.  When this effect is combined with a
  4. ;decrease in palette values at the same line, you can create the illusion of
  5. ;water.
  6. ;
  7. ;Use  the  mouse  to  move  the mirror up and down.  LMB exits.
  8.  
  9.     opt    o+
  10.  
  11.     INCLUDE    "exec/exec_lib.i"
  12.     INCLUDE    "games/games_lib.i"
  13.     INCLUDE    "games/games.i"
  14.  
  15. CALL    MACRO
  16.     jsr    _LVO\1(a6)
  17.     ENDM
  18.  
  19.     SECTION    "MirrorDemo",CODE
  20.  
  21. ;===========================================================================;
  22. ;                             INITIALISE DEMO
  23. ;===========================================================================;
  24.  
  25. Start:    MOVEM.L    A0-A6/D1-D7,-(SP)
  26.     move.l    ($4).w,a6
  27.     lea    GMS_Name(pc),a1
  28.     moveq    #$00,d0
  29.     CALL    OpenLibrary
  30.     move.l    d0,GMS_Base
  31.     beq    Quit
  32.  
  33.     move.l    GMS_Base(pc),a6
  34.     CALL    SetUserPri
  35.  
  36.     move.l    GMS_Base(pc),a6          ;Initialise our screen.
  37.     lea    ScreenStruct(pc),a0
  38.     CALL    Add_Screen
  39.     tst.l    d0
  40.     bne.s    Error
  41.  
  42.     move.l    SS_MemPtr1(a0),a1        ;a1 = Destination.
  43.     lea    PackedPicFile(pc),a0     ;a0 = File Name.
  44.     moveq    #$00,d0                  ;d0 = Password
  45.     CALL    SmartLoad
  46.     tst.l    d0
  47.     beq.s    ReturnToDOS
  48.  
  49.     lea    ScreenStruct(pc),a0      ;Now show the screen/pic.
  50.     CALL    Show_Screen
  51.  
  52.     moveq    #JPORT1,d0               ;Initialise Mouse Port 1.
  53.     CALL    Read_Mouse
  54.  
  55. ;===========================================================================;
  56. ;                                MAIN CODE
  57. ;===========================================================================;
  58.  
  59. Loop:    CALL    Wait_OSVBL
  60.     CALL    Update_RasterLines
  61.  
  62.     moveq    #JPORT1,d0
  63.     CALL    Read_Mouse
  64.     ext.w    d0
  65.     add.w    d0,RasterList+2
  66.  
  67. .chk129    cmp.w    #129,RasterList+2
  68.     bgt.s    .chk256
  69.     move.w    #129,RasterList+2
  70.  
  71. .chk256    cmp.w    #255,RasterList+2
  72.     blt.s    .chklmb
  73.     move.w    #255,RasterList+2
  74.  
  75. .chklmb    btst    #MB_LMB,d0
  76.     beq.s    Loop
  77.  
  78.     moveq    #$00,d0                  ;d0 = FadeState, initialise to 0.
  79.     moveq    #4,d1                    ;d1 = Speed of fade.
  80. Fade:    CALL    Wait_OSVBL
  81.     CALL    B24_FadeToBlack          ;Do the fade routine.
  82.     tst.w    d0                       ;Has the fade finished yet?
  83.     bne.s    Fade                     ;If not, keep going.
  84.  
  85. ;===========================================================================;
  86. ;                              RETURN TO DOS
  87. ;===========================================================================;
  88.  
  89. ReturnToDOS:
  90.     move.l    GMS_Base(pc),a6
  91.     lea    ScreenStruct(pc),a0
  92.     CALL    Delete_Screen            ;Give back screen memory etc.
  93. Error:    move.l    GMS_Base(pc),a1
  94.     move.l    ($4).w,a6
  95.     CALL    CloseLibrary
  96. Quit:    MOVEM.L    (SP)+,A0-A6/D1-D7
  97.     moveq    #$00,d0
  98.     rts
  99.  
  100. ;===========================================================================;
  101. ;                                  DATA
  102. ;===========================================================================;
  103.  
  104. GMS_Name:
  105.     dc.b    "games.library",0
  106.     even
  107. GMS_Base:
  108.     dc.l    0
  109.  
  110. AMT_PLANES =    7
  111.  
  112. ScreenStruct:
  113.     dc.l    "GSV1",0
  114.     dc.l    0,0,0             ;Screen_Mem1/2/3
  115.     dc.l    0                 ;Screen link.
  116.     dc.l    Palette           ;Address of screen palette.
  117.     dc.l    RasterList        ;Address of rasterlist.
  118.     dc.l    0                 ;Amt of colours in palette.
  119.     dc.w    320,256,320,256   ;Screen & Pic Height/Width.
  120.     dc.w    AMT_PLANES        ;Amt_Planes
  121.     dc.w    0,0               ;X/Y screen offset.
  122.     dc.w    0,0               ;X/Y picture offset.
  123.     dc.l    0                 ;Special attributes.
  124.     dc.w    LORES|COL24BIT    ;Screen mode.
  125.     dc.b    INTERLEAVED       ;Screen type
  126.     dc.b    0                 ;Reserved
  127.     even
  128.  
  129. RasterList:
  130.     WAITLINE 164
  131.     MIRROR
  132.     RASTEND
  133.  
  134. Palette    dc.l    $000000,$FFFFFF,$FAF5F2,$FAE8E7
  135.     dc.l    $EEDED5,$E8D4C8,$DDC0AF,$D7B5A2
  136.     dc.l    $D1AC96,$DCA491,$CBA38B,$C5997E
  137.     dc.l    $BD8E74,$B5846A,$AD7A5F,$A57056
  138.     dc.l    $9D674D,$955D44,$8C533B,$844B34
  139.     dc.l    $7C432D,$743B26,$6C3320,$642D1B
  140.     dc.l    $5C2616,$532010,$4A1D0C,$411A09
  141.     dc.l    $381606,$2F1204,$260F02,$1D0C00
  142.     dc.l    $AC783A,$A67139,$A06C39,$986638
  143.     dc.l    $995F36,$906037,$8C5C36,$945733
  144.     dc.l    $865735,$905030,$7E5133,$8D4B2E
  145.     dc.l    $764B31,$6E4630,$8A462D,$64412B
  146.     dc.l    $5D3D27,$593A24,$543822,$50351F
  147.     dc.l    $4B341D,$47301A,$592218,$402D17
  148.     dc.l    $382813,$3B2007,$302310,$2B200D
  149.     dc.l    $331100,$430907,$3C0504,$2E0202
  150.     dc.l    $B48038,$B7743D,$AE6350,$A85D4A
  151.     dc.l    $A35644,$9E503E,$994A39,$944534
  152.     dc.l    $9F4336,$8E3F30,$87412B,$87382A
  153.     dc.l    $823628,$803226,$792C21,$72251C
  154.     dc.l    $E1AB98,$DBA28C,$D79C89,$D29582
  155.     dc.l    $CD8D7A,$C88672,$C27E6B,$BD7764
  156.     dc.l    $B8705D,$B36A57,$BB5244,$AD4A3D
  157.     dc.l    $C8594A,$7F7444,$847D49,$67271E
  158.     dc.l    $6C2219,$651D15,$5E1711,$57130E
  159.     dc.l    $500F0B,$4A0C09,$350303,$270000
  160.     dc.l    $89874E,$8C8E53,$8C9358,$8E9D62
  161.     dc.l    $C6904A,$9AA467,$CD9E51,$AFAE6F
  162.     dc.l    $E3D765,$D5AE58,$BCAD78,$C1AC7C
  163.     dc.l    $CBAA82,$D5A588,$EAA09B,$ECA7A2
  164.     dc.l    $EDADA9,$EFB5B1,$F0BBB8,$F2C2BF
  165.     dc.l    $F4CBC8,$F5D1CF,$F7D9D7,$FDF7F7
  166.  
  167. PackedPicFile:
  168.     dc.b    "GAMESLIB:data/Yattering128.pak",0
  169.     even
  170.  
  171.